import React, { PureComponent } from 'react'
import { View, Text, SafeAreaView, StyleSheet, WebView, requireNativeComponent, Platform } from 'react-native'
import AndroidWebView from '../../components/AndroidWebView'


export default class CustomService extends PureComponent {





    render() {
        return view
    }
    _loadSuccess = () => {
        console.log('加载成功')
    }
    _loadEnd = () => {
        console.log('加载完成')
    }
    _loadError = () => {
        console.log('加载失败')
    }
}

const styles = StyleSheet.create({
    container: {
        flex: 1
    }
})

const view = Platform.select({
    ios: (<SafeAreaView style={{ flex: 1, backgroundColor: 'rgb(36,144,268)' }}>
        <WebView source={{ uri: 'http://121.18.229.58:20001/liveapp/customer-center' }}
            onLoad={this._loadSuccess}
            onLoadEnd={this._loadEnd}
            onError={this._loadError}
            style={styles.container}
        />
    </SafeAreaView>),
    android: (<AndroidWebView
        para={{
            url: "http://121.18.229.58:20001/liveapp/customer-center",
            domain: "121.18.229.58"
        }}
        style={styles.container} />)
})